<#assign channelId = 10 />
<#assign pageHeader>
</#assign>
<#assign pageContent>
    <div class="body-wrap">
        <div class="type-box white-bg">
            <div class="content-wrap">
                <#if categoryRoots?? && categoryRoots?size gt 0>
                <div class="clearfix">
                    <span>专业：</span>
                    <ul class="fl">
                        <a title="不限" href="/picture/list.html?categoryId=0">
                            <li <#if params.categoryId==0>class="active"</#if>>不限</li>
                        </a>
                        <#list categoryRoots as category>
                            <a  title="${category.categoryName}" href="/picture/list.html?categoryId=${category.categoryId}">
                                <li <#if categoryRootId==category.categoryId>class="active"</#if>>${category.categoryName}</li>
                            </a>
                        </#list>
                    </ul>
                </div>
                </#if>
                <#if categoryChildren?? && categoryChildren?size gt 0>
                    <div class="clearfix">
                        <span>分类：</span>
                        <ul class="fl">
                            <a title="不限" href="/picture/list.html?categoryId=${categoryRootId!}">
                                <li <#if params.categoryId==categoryRootId>class="active"</#if>>不限</li>
                            </a>
                            <#list categoryChildren as child>
                                <a title="${child.categoryName}" href="/picture/list.html?categoryId=${child.categoryId}">
                                     <li <#if categoryParentId==child.categoryId>class="active"</#if>>${child.categoryName}</li>
                                </a>
                            </#list>
                        </ul>
                    </div>
                </#if>
                <#if categorySons?? && categorySons?size gt 0>
                    <div class="clearfix">
                        <span>子类：</span>
                        <ul class="fl">
                            <a title="不限" href="/picture/list.html?categoryId=${categoryParentId!}">
                                <li <#if params.categoryId==categoryParentId>class="active"</#if>>不限</li>
                            </a>
                            <#list categorySons as sonCategory>
                                <a title="${sonCategory.categoryName}" href="/picture/list.html?categoryId=${sonCategory.categoryId}">
                                    <li <#if params.categoryId==sonCategory.categoryId>class="active"</#if>>${sonCategory.categoryName}</li>
                                </a>
                            </#list>
                        </ul>
                    </div>
                </#if>
                <#if pictureAlbums?? && pictureAlbums?size gt 0>
                    <div class="clearfix">
                        <span>专集：</span>
                        <ul class="fl">
                            <a title="不限" href="/picture/list.html?categoryId=${params.categoryId!}">
                                <li <#if params.albumId==0>class="active"</#if>>不限</li>
                            </a>
                            <#list pictureAlbums as album>
                                <a title="${album.title}" href="/picture/list.html?albumId=${album.id}">
                                    <li <#if params.albumId==album.id>class="active"</#if>>${album.title}</li>
                                </a>
                            </#list>
                        </ul>
                    </div>
                </#if>
            </div>
        </div>
        <div class="filter-box white-bg mb-20">
            <div class="content-wrap">
                <div class="fl">
                    <span class="item <#if params.orderBy == 0>active</#if>" onclick="setOrderBy(0)">综合</span>
                    <span class="division">|</span>
                    <span class="item <#if params.orderBy == 1>active</#if>" onclick="setOrderBy(1)">热门</span>
                    <span class="division">|</span>
                    <span class="item <#if params.orderBy == 2>active</#if>" onclick="setOrderBy(2)">下载</span>
                </div>
                <div class="fr">
                    <div class="layui-form">
                        <label for="isFree">
                            <input type="checkbox" onclick="setIsFree()" id="isFree" value="1" title="免费" lay-skin="primary" <#if params.isFree gt 0 >checked</#if>>
                        </label>
                        <label for="isVip">
                            <input type="checkbox" onclick="setIsVip()" id="isVip" value="1" title="VIP" lay-skin="primary" <#if params.levelId?? && params.levelId gt 0 >checked</#if>>
                        </label>
                    </div>
                </div>
            </div>
        </div>
        <div class="content-wrap">
            <#if pictureAlbumVoList?? && pictureAlbumVoList?size gt 0>
                <div class="album-list">
                    <#list pictureAlbumVoList as item>
                            <div class="list-items">
                                <a href="/picture/album/view/${item.id}.html" class="list-item">
                                    <div class="list-content">
                                        <div class="list-album-img-box">
                                            <#list item.pictures as pic>
                                                 <img lay-src="${pic.coverUrl!}" alt="">
                                            </#list>
                                        </div>
                                        <div class="list-album-info">${item.title!}</div>
                                        <div class="list-album-type">专集</div>
                                    </div>
                                </a>
                            </div>
                    </#list>
                </div>
            </#if>
            <ul class="works clearfix">
                <#if pictureList?? && pictureList?size gt 0 >
                    <#list pictureList as item>
                        <li class="work">
                            <div class="work-content">
                                <a class="work-img" href="/picture/view/${item.id}.html" target="_blank">
                                    <img class="lazy" lay-src="${item.coverUrl!}">
                                </a>
                                <div class="picName">${item.title!}</div>
                                <#if item.levelId?? && item.levelId gt 0>
                                    <div class="type-vip">VIP</div>
                                </#if>
                                <div class="active">
                                    <a class="layui-btn layui-btn-primary" href="javascript:;" onclick="favorites(${item.id},4,this)">收藏</a>
                                    <a class="layui-btn layui-btn-normal" href="/picture/view/${item.id}.html">详情</a>
                                </div>
                            </div>
                        </li>
                    </#list>
                    <#else>
                        <div class="data-null">
                            <i class="icon-data-null"></i>
                            <p>小编还没有整理内容哦，去看看其它吧</p>
                        </div>
                </#if>
            </ul>
        </div>
        <!--分页 s-->
        <#if pictureList?? && pictureList?size gt 0 >
            <div id="list-ft" class="page-box content-wrap"></div>
        </#if>
        <!--分页 e-->
    </div>
</#assign>
<#assign pageFooter>
    <script type="text/javascript">
        var categoryId = ${params.categoryId};
        var albumId = ${params.albumId};
        var isFree = ${params.isFree};
        var levelId = ${params.levelId};
        var orderBy = ${params.orderBy};
        var pageSize = ${page.pageSize};
        var currentPage = ${page.currentPage};
        var totalRecords = ${page.totalRecords};
        $(function () {
            layui.laypage.render({
                elem: 'list-ft'
                , theme: '#1E9FFF'
                , limit: pageSize
                , curr: currentPage
                , count: totalRecords //数据总数，从服务端得到
                , jump: function (obj, first) {
                    //console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                    //console.log(obj.limit); //得到每页显示的条数
                    //首次不执行
                    if (!first) {
                        jumpPage(obj.curr);
                        return false
                    }
                }
            });
        });
    </script>
    <script src="/static/js/picture/picture.js"></script>
</#assign>
<#include "../layouts/layout.ftl">

